package php4dvdPages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import php4dvdTests.MyPageFactory;

/**
 * @author Anna Alexeyenko
 *         Date: 1/26/13
 */
public class ProfilePage extends InternalPage {

    @FindBy(id = "username")
    private WebElement userNameField;

    @FindBy(id = "email")
    private WebElement emailField;

    @FindBy(id = "password")
    private WebElement passwordField;

    @FindBy(id = "password2")
    private WebElement password2Field;

    @FindBy(name = "permission")
    private WebElement roleField;

    @FindBy(name = "submit")
    private WebElement saveButton;

    public ProfilePage changePassword(String newPass) {
        passwordField.sendKeys(newPass);
        password2Field.sendKeys(newPass);
        saveButton.click();
        return MyPageFactory.getPage(driver, ProfilePage.class);
    }



}
